﻿using System;
using System.Collections.Generic;
using System.Text;
using Core.Parser.ASN1Parser.Nodes;
using Core.Model;

namespace Core.Parser.ASN1Parser.Builders
{
    internal class LineArtBuilder
    {
        internal static void Build(TaggedNode node, LineArt art, Group group)
        {
            VisibleBuilder.Build(node, art, group);

            TaggedNode e;

            if ((e = node[ASN1ContextCodes.C_BORDERED_BOUNDING_BOX]) != null)
                art.BorderedBoundingBox = e.First.BoolValue;

            if ((e = node[ASN1ContextCodes.C_ORIGINAL_LINE_WIDTH]) != null)
                art.OriginalLineWidth = e.First.IntValue;

            if ((e = node[ASN1ContextCodes.C_ORIGINAL_LINE_STYLE]) != null)
                art.OriginalLineStyle = (LineArt.LineArtLineStyle) e.First.IntValue;

            if ((e = node[ASN1ContextCodes.C_ORIGINAL_REF_LINE_COLOUR]) != null)
                art.OriginalRefLineColour = ColourBuilder.Build(e.First, group);

            if ((e = node[ASN1ContextCodes.C_ORIGINAL_REF_FILL_COLOUR]) != null)
                art.OriginalRefFillColour = ColourBuilder.Build(e.First, group);

        }
    }
}
